package com.yowasa.xiuxian.engine.item.miji;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Item;
import com.yowasa.xiuxian.engine.item.ItemInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ItemTypeEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.util.RandomUtil;

import java.util.List;


@Item(name = "西风秘典", type = ItemTypeEnum.MI_JI, price = 5000)
public class HongTianMiDian implements ItemInterface {

    @Override
    public String desc() {
        return "随机获取一个蒙德城的神通";
    }

    @Override
    public String effect(UserBO userBO) {

        List<String> able = Lists.newArrayList("遮天诀", "千里神行", "百锻成仙", "五行轮转", "五德之身", "仙灵店铺", "净水之息");
        String choice = RandomUtil.choice(able);
        if (userBO.getUserConfig().getKnownSpecialEffect().contains(choice)) {
            return "你获取了神通【" + choice + "】的修习之法,但是你已经知晓了";
        } else {
            userBO.getUserConfig().getKnownSpecialEffect().add(choice);
            return "你获取了神通【" + choice + "】的修习之法";
        }
    }

}
